#define  _CRT_SECURE_NO_WARNINGS

class Solution {
public:
    bool isPalindrome(string s)
    {
        string s2;
        for (auto e : s)
        {
            if (isalnum(e))
            {
                s2 += tolower(e);
            }
        }
        int n = s2.size();
        int left = 0;
        int right = n - 1;
        while (left < right)
        {
            if (s2[left] != s2[right])
            {
                return false;
            }
            left++;
            right--;
        }
        return true;
    }
};